// hooks/totalPicture.js
export const renderChart = (option, legendData, seriesData) => {
  // 直接修改传入的 ref 对象的值
  option = {
    title: {
      text: '事件类型分析',
      left: 'center',
    },
    tooltip: {
      trigger: 'item',
      formatter: '{a} <br/>{b}: {c} ({d}%)',
    },
    legend: {
      orient: 'horizontal',
      left: 'center',
      bottom: '10',
      data: legendData,
    },
    series: [
      {
        name: 'EVENT TYPE',
        type: 'pie',
        roseType: 'radius',
        radius: ['15%', '70%'],
        center: ['50%', '50%'],
        data: seriesData,
        animationEasing: 'cubicInOut',
        animationDuration: 2700,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)',
          },
        },
      },
    ],
  };
};
